import React from 'react';
import { useNavigate, useParams } from 'react-router-dom';

export function withRouterNavigate(Wrapped) {
  return function ComponentWithNavigate(props) {
    const navigate = useNavigate();
    return <Wrapped {...props} navigate={navigate} />;
  };
}

export function withRouterParams(Wrapped) {
  return function ComponentWithParams(props) {
    const params = useParams();
    const navigate = useNavigate();
    return <Wrapped {...props} params={params} navigate={navigate} />;
  };
}


